package st.lib.base.delegate.bottom;

import java.util.LinkedHashMap;

/**
 * 简单工厂模式
 *
 * @author zhangyu
 * @date 2017/10/27
 */

public final class ItemBuilder {
    private final LinkedHashMap<BottomTitleBean, BottomItemDelegate> ITEMS = new LinkedHashMap<>();

    public static ItemBuilder builder() {
        return new ItemBuilder();
    }

    public final ItemBuilder addItem(BottomTitleBean titleBean, BottomItemDelegate delegate) {
        ITEMS.put(titleBean, delegate);
        return this;
    }

    public final ItemBuilder addItems(LinkedHashMap<BottomTitleBean, BottomItemDelegate> map) {
        ITEMS.putAll(map);
        return this;
    }

    public final LinkedHashMap<BottomTitleBean, BottomItemDelegate> build() {
        return ITEMS;
    }
}
